Row PropertiesFreeform template

Description

Define the field's control layout using the freeform editor. This property is only available if Freeform layout is checked for the field.

Discussion

The Freeform template defines the freeform layout of the column. The layout can include HTML tags and field placeholders.

images/freeformLayout1.png

Field Placeholders

Field placeholders can be placed in the freeform layout for a control. There are two types of placeholders available:

{fieldname}

Represents the HTML control definition for the 'feildname' field.

{data.fieldname}

Represents the data value of the 'fieldname' field.

At run-time, when the placeholders are replaced, they are replaced with the 'control' definition.

So, for example, if the Lastname field is defined as a textbox control, then at run-time if the lastname field has a value of 'Smith' the {lastname} placeholder is replaced by the HTML control definition, which would be something like this:

<input name="lastname" value="Smith"/>

However, there may be situations were you want a reference to the data in the field ('Smith' in this example), rather than the HTML control definition. In this case use the {data.lastname} placeholder. At run-time, this placeholder would be replaced by 'Smith'.

Referencing Page or Session Variables

You might want to include page and session variables in the freeform edit region. To do so, you use a <%A5....%> code block in your freeform edit region.

For example, the freeform edit region shown here includes placeholders for {field1} and {field2} and it also displays the value of a page variable called 'pvar1' and a session variable called 'session.svar1'

Note that is very important that the variables that you reference are DIMmed using the 'default' keyword so that if they are not present, the code will not cause an error.

{field1}{field2}<br/><%A5
dim pvar1 as c = default ""
dim session.svar1 as c = default ""
? "pvar1 is: " + pvar1 + " and svar1 is: " session.svar1
%>

'Page' variables are defined in the query string for the page. For example if the URL for the page you are viewing is:

http://www.mysite.com/page1.a5w?category=software&type=database

then there are two page variables, 'category' and 'type'.